Skip to content

update(heatmap-basic): plotly — comprehensive quality review#4254

Merged
github-actions[bot] merged 7 commits intomainfrom
implementation/heatmap-basic/plotly
Feb 15, 2026
Merged

update(heatmap-basic): plotly — comprehensive quality review#4254
github-actions[bot] merged 7 commits intomainfrom
implementation/heatmap-basic/plotly

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Updated plotly implementation for heatmap-basic.

Changes: Comprehensive quality review — fix weaknesses from prior reviews, preserve strengths, improve quality across all dimensions.

Changes

  • Addressed review weaknesses from prior quality assessment
  • Improved data choice and visual design
  • Enhanced library-specific feature usage
  • Updated to current library and Python versions
  • Quality self-assessment: pending CI review

Test Plan

  • Preview images uploaded to GCS staging
  • Implementation file passes ruff format/check
  • Metadata YAML updated with current versions
  • Automated review triggered

Generated with Claude Code /update command

Copilot AI review requested due to automatic review settings February 15, 2026 21:27
Comprehensive quality review: fix weaknesses from prior reviews, preserve strengths, improve quality across all dimensions.
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 15, 2026

AI Review - Attempt 1/3

Image Description

The plot displays an 8×12 heatmap of monthly sales growth percentages across product categories (Electronics, Clothing, Food & Beverage, Books, Sports, Home & Garden, Beauty, Toys) and months (Jan–Dec). A diverging RdBu colorscale is used, centered at 0% — red/warm tones indicate positive growth and blue/cool tones indicate negative growth. Each cell is annotated with its numerical value including +/- signs. A vertical colorbar on the right is labeled "Sales Growth (%)" with percentage tick marks ranging from roughly -20% to +20%. The title reads "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" centered at the top. White gaps separate the cells cleanly. Clear seasonal patterns are visible: summer months (Jun–Aug) show warm red tones for Sports, Home & Garden, and Toys; November–December show strong reds for Beauty, Books, Electronics, and Toys (holiday season). The layout uses a plotly_white template with a clean white background.

Quality Score: 88/100

Criteria Checklist

Visual Quality (27/30)

  • VQ-01: Text Legibility (8/8) — All font sizes explicitly set: title 28pt, axis labels 22pt, ticks 18pt, cell annotations 14pt, colorbar title 20pt, colorbar ticks 16pt
  • VQ-02: No Overlap (6/6) — No overlapping text; xgap/ygap=2 separates cells cleanly
  • VQ-03: Element Visibility (5/6) — Cells well-sized for 8×12 grid, though slightly more prominent cells would help
  • VQ-04: Color Accessibility (4/4) — RdBu_r diverging colorscale is colorblind-safe with strong contrast
  • VQ-05: Layout Balance (2/4) — Colorbar creates right-side asymmetry; plot area could use more canvas space
  • VQ-06: Axis Labels & Title (2/2) — Descriptive labels "Month" and "Product Category"; colorbar includes "%" units

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (6/8) — Strong design: intentional diverging palette centered on zero, plotly_white template, cell gaps add polish. Above defaults but not FiveThirtyEight-level
  • DE-02: Visual Refinement (4/6) — plotly_white removes chart junk, cell gaps create separation, generous margins. Could benefit from subtitle or custom fonts
  • DE-03: Data Storytelling (3/6) — Seasonal patterns create natural visual clusters, but no subtitle or callout to guide viewer to the insight. Viewer must discover the story themselves

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct: go.Heatmap
  • SC-02: Required Features (4/4) — All spec features present: diverging colormap (RdBu_r + zmid=0), value annotations, colorbar, logically ordered axes
  • SC-03: Data Mapping (3/3) — X=months, Y=categories, Z=values correctly assigned
  • SC-04: Title & Legend (3/3) — Title follows required format; colorbar serves as legend

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — Shows positive/negative values, seasonal patterns, cross-category variation. Could show more extreme contrasts
  • DQ-02: Realistic Context (5/5) — Realistic retail scenario with plausible seasonal patterns
  • DQ-03: Appropriate Scale (4/4) — Values -21% to +30%, realistic for retail sales growth

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean flow: imports → data → plot → layout → save
  • CQ-02: Reproducibility (2/2) — np.random.seed(42)
  • CQ-03: Clean Imports (2/2) — Only numpy and plotly.graph_objects
  • CQ-04: Code Elegance (2/2) — Clean, Pythonic; seasonal pattern loop is appropriate complexity
  • CQ-05: Output & API (1/1) — Saves plot.png at 4800×2700 (1600×900, scale=3) + HTML export

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) — Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, xgap/ygap, colorbar dict
  • LM-02: Distinctive Features (4/5) — Plotly-specific: hovertemplate with , texttemplate formatting, zmid for diverging center, HTML export for interactivity

Strengths

  • Excellent spec compliance — all four notes from the specification are implemented (diverging colormap, cell annotations, colorbar, logical ordering)
  • Strong Plotly idiom usage — zmid for diverging center, texttemplate with format specifiers, hovertemplate for interactive tooltips, xgap/ygap for cell separation
  • Realistic and engaging dataset with clear seasonal business patterns (summer outdoor/leisure, holiday gift categories)
  • All font sizes explicitly set at appropriate scales for 4800×2700 output
  • Clean KISS code structure with appropriate complexity for data generation

Weaknesses

  • Layout balance could be improved — colorbar creates right-side asymmetry and the plot area doesn't maximize canvas utilization
  • No subtitle or contextual annotation to guide the viewer toward the seasonal patterns — the story is there in the data but the viewer must discover it
  • Cell annotation text at 14pt is functional but could be slightly larger for easier reading at a glance

Verdict: REJECTED

@github-actions github-actions Bot added quality:88 Quality score: 88/100 ai-rejected Quality not OK, triggers update labels Feb 15, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Feb 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the plotly implementation for the heatmap-basic plot spec, along with spec/metadata refreshes to reflect the latest revision.

Changes:

  • Updated spec tracking metadata and added matrix to classification tags.
  • Refined the spec guidance note (row/column ordering).
  • Revised Plotly implementation + Plotly metadata to newer Python/Plotly versions and updated visual/data design.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
plots/heatmap-basic/specification.yaml Bumps spec updated timestamp and adds matrix tag for classification.
plots/heatmap-basic/specification.md Updates guidance note to emphasize logical ordering of rows/columns.
plots/heatmap-basic/metadata/plotly.yaml Updates Plotly implementation metadata (versions, generator, quality_score placeholder).
plots/heatmap-basic/implementations/plotly.py Updates the Plotly heatmap output to a diverging, zero-centered “growth (%)” design with improved hover/annotations.

values[:, month_idx] += 15
for month_idx in [10, 11]: # Holiday boost
values[:, month_idx] += 25
# Monthly sales growth (%) relative to annual average — diverging around zero
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the values are "Monthly sales growth (%) relative to annual average", but the code generates values directly from a normal distribution plus seasonal offsets and never computes growth relative to an average/baseline. Either adjust the comment to match what’s generated, or compute the baseline and express values as growth relative to it.

Suggested change
# Monthly sales growth (%) relative to annual average — diverging around zero
# Simulated monthly sales growth (%) with seasonal patterns, diverging around zero

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +13
library_version: 6.5.2
preview_url: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.png
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot_thumb.png
preview_html: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.html
quality_score: 92
quality_score: 88
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata’s embedded review content (strengths/weaknesses/image_description/criteria_checklist) still describes the old visualization (e.g., "Sales ($K)" units and the older category names), but the implementation now plots "Sales Growth (%)" with updated categories. Please regenerate or update the review block so it matches the current code output; otherwise the synced DB review fields will be misleading.

Copilot uses AI. Check for mistakes.
Library: plotly 6.5.0 | Python 3.13.11
Quality: 92/100 | Created: 2025-12-23
Library: plotly 6.5.2 | Python 3.14.3
Quality: 88/100 | Updated: 2026-02-15
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation header doesn’t follow the repository’s standard 4-line plot header format: it removes the space after the opening triple quotes and the Quality field is left blank ("Quality: /100"), which makes the header invalid/incomplete. Please align this header with the established pattern used by other Plotly implementations (include a numeric quality score and the usual "Created:" field).

Suggested change
Quality: 88/100 | Updated: 2026-02-15
Quality: 88/100 | Created: 2026-02-15

Copilot uses AI. Check for mistakes.
Attempt 1/3 - fixes based on AI review
@github-actions
Copy link
Copy Markdown
Contributor

🔧 Repair Attempt 1/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 15, 2026

AI Review - Attempt 2/3

Image Description

The plot displays a heatmap of monthly sales growth percentages for 8 retail product categories (Electronics, Clothing, Food & Beverage, Books, Sports, Home & Garden, Beauty, Toys) across all 12 months (Jan–Dec). A diverging RdBu colorscale is used, centered at zero — blue tones for negative growth, red/warm tones for positive growth. Each cell contains an annotated value with sign (e.g., +14.3, -15.3). The title reads "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" with a gray subtitle: "Retail categories show clear seasonal surges — summer outdoor/leisure peaks and Q4 holiday gift spikes." A colorbar on the right shows "Sales Growth (%)" ranging from roughly -20% to +20%. Clear seasonal patterns are visible: Sports, Home & Garden, and Toys show summer peaks (Jun–Aug in dark red), while Electronics, Toys, Books, and Beauty show holiday spikes (Nov–Dec in deep red/maroon). Clothing shows spring (Apr) and back-to-school (Sep) bumps. The background is clean white with subtle gaps between cells.

Quality Score: 89/100

Criteria Checklist

Visual Quality (27/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set: title 28pt, axis titles 22pt, ticks 18pt, cell text 16pt, colorbar title 20pt
  • VQ-02: No Overlap (6/6) - No overlapping elements; annotations fit within cells
  • VQ-03: Element Visibility (5/6) - Cells well-sized for 8×12 matrix with 2px gaps; slightly generous sizing
  • VQ-04: Color Accessibility (4/4) - RdBu diverging colorscale is colorblind-safe with good contrast
  • VQ-05: Layout Balance (2/4) - Layout is functional but left margin at 160px and right-side colorbar leave the heatmap area somewhat constrained; moderate unused whitespace
  • VQ-06: Axis Labels & Title (2/2) - Descriptive labels with units: "Month", "Product Category", "Sales Growth (%)"

Design Excellence (14/20)

  • DE-01: Aesthetic Sophistication (6/8) - Strong design: RdBu diverging scale, plotly_white template, gray subtitle, styled colorbar with tick suffix. Above default but not yet publication-level polish
  • DE-02: Visual Refinement (4/6) - Good refinement with clean template, cell gaps, custom margins, centered title with subtitle. Could improve with custom font family or additional typographic refinement
  • DE-03: Data Storytelling (4/6) - Subtitle guides reader to seasonal story; data engineered with realistic patterns; color divergence around zero creates immediate visual hierarchy

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct basic heatmap with color intensity
  • SC-02: Required Features (4/4) - All spec features: diverging colormap, cell annotations, colorbar legend, logically ordered rows/columns
  • SC-03: Data Mapping (3/3) - X=months, Y=categories, Z=values correctly mapped
  • SC-04: Title Format (3/3) - Correct format: "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai"

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) - Shows positive and negative values, range of magnitudes, clear patterns; could show more extreme outliers
  • DQ-02: Realistic Context (5/5) - Realistic retail scenario with plausible seasonal patterns
  • DQ-03: Appropriate Scale (4/4) - Values range -21% to +30%, realistic for monthly sales growth

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Clean imports → data → plot → layout → save
  • CQ-02: Reproducibility (2/2) - np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects imported
  • CQ-04: Code Elegance (2/2) - Clean, Pythonic seasonal pattern generation
  • CQ-05: Output & API (1/1) - Saves plot.png at 4800×2700 via scale=3

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, colorbar dict
  • LM-02: Distinctive Features (4/5) - Plotly-specific: hovertemplate with HTML, HTML subtitle in title, interactive HTML export, zmid for diverging center

Strengths

  • Excellent text legibility with all font sizes explicitly configured for the target resolution
  • Effective diverging RdBu colorscale centered at zero with zmid — immediately reveals positive vs. negative growth
  • Thoughtful data storytelling: subtitle guides reader to seasonal patterns, data engineered with realistic seasonal effects (summer outdoor peaks, Q4 holiday spikes, spring fashion, back-to-school)
  • Rich Plotly-specific features: hovertemplate with HTML formatting, HTML subtitle, interactive HTML alongside static PNG
  • Clean KISS code structure with elegant seasonal pattern generation loop

Weaknesses

  • Canvas utilization could be tighter — left margin (160px) and colorbar placement leave the heatmap area somewhat constrained with moderate whitespace (VQ-05: 2/4)
  • Aesthetic polish is strong but falls short of publication-ready — could benefit from a custom font family or more typographic refinement (DE-01: 6/8)
  • Cell annotations using texttemplate format "+.0f" rounds to integers, losing the decimal precision available in the data (minor precision trade-off)

Verdict: REJECTED

@github-actions github-actions Bot added quality:89 Quality score 89/100 ai-rejected Quality not OK, triggers update labels Feb 15, 2026
Copilot AI review requested due to automatic review settings February 15, 2026 21:38
@github-actions github-actions Bot added the ai-attempt-2 Second repair attempt label Feb 15, 2026
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 15, 2026 21:38
@github-actions github-actions Bot removed the ai-rejected Quality not OK, triggers update label Feb 15, 2026
Attempt 2/3 - fixes based on AI review
Copilot AI review requested due to automatic review settings February 15, 2026 21:40
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 15, 2026 21:40
@github-actions
Copy link
Copy Markdown
Contributor

🔧 Repair Attempt 2/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 15, 2026

AI Review - Attempt 3/3

Image Description

The plot displays an 8×12 heatmap of monthly sales growth percentages across retail product categories (Electronics, Clothing, Food & Beverage, Books, Sports, Home & Garden, Beauty, Toys) over 12 months (Jan–Dec). A diverging RdBu colorscale is used, centered at zero: deep red cells indicate strong positive growth (up to ~30%), deep blue cells indicate strong negative growth (down to ~-21%), and near-white cells are close to zero. Every cell contains a signed numeric annotation (e.g., "+20.2", "-15.3"). The title reads "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" with a gray subtitle describing seasonal patterns. Axes are labeled "Month" (x) and "Product Category" (y). A vertical colorbar on the right shows "Sales Growth (%)" with percentage tick marks. Cells are separated by small gaps. The background is a light off-white (#fafafa), and the typography uses a serif font (Palatino/Georgia). The layout is landscape format at 1600×900 (scaled 3×).

Quality Score: 92/100

Criteria Checklist

Visual Quality (28/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set: title 28pt, axis titles 22pt, ticks 18pt, annotations 15pt, colorbar title 20pt, colorbar ticks 16pt
  • VQ-02: No Overlap (6/6) - No overlapping text; cell gaps separate annotations cleanly
  • VQ-03: Element Visibility (6/6) - Heatmap cells well-sized for 8×12 matrix, all clearly visible
  • VQ-04: Color Accessibility (4/4) - RdBu diverging colormap is colorblind-distinguishable (blue vs red)
  • VQ-05: Layout Balance (2/4) - Heatmap fills canvas well but colorbar label is slightly tight against right edge; minor proportion issue
  • VQ-06: Axis Labels & Title (2/2) - Descriptive labels "Month" and "Product Category"; colorbar shows "Sales Growth (%)" with units

Design Excellence (16/20)

  • DE-01: Aesthetic Sophistication (7/8) - Publication-quality serif typography (Palatino), intentional diverging colormap centered at zero, cell gaps, muted background, styled colorbar without outline — clearly above defaults
  • DE-02: Visual Refinement (5/6) - plotly_white template, cell gaps for separation, styled subtitle with color/size hierarchy, generous whitespace. Nearly perfect but small gap from ideal polish
  • DE-03: Data Storytelling (4/6) - Seasonal patterns visually evident through color intensity; subtitle explicitly states the insight; visual hierarchy guides the viewer to summer and Q4 peaks

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct heatmap with matrix format and color intensity mapping
  • SC-02: Required Features (4/4) - Diverging colormap for pos/neg values, value annotations in cells, colorbar legend, logically ordered categories
  • SC-03: Data Mapping (3/3) - X=months, Y=categories, values→color. All data visible
  • SC-04: Title & Legend (3/3) - Title format "heatmap-basic · plotly · pyplots.ai" correct; colorbar serves as legend

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Full range of positive and negative values, clear seasonal patterns, varying magnitudes across categories
  • DQ-02: Realistic Context (5/5) - Retail sales growth across product categories with plausible seasonal patterns (summer outdoor, holiday gifts, spring fashion)
  • DQ-03: Appropriate Scale (4/4) - Growth percentages -21% to +30% are realistic for retail category comparisons

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Clean Imports → Data → Plot → Save structure, no functions/classes
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) set
  • CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects imported
  • CQ-04: Code Elegance (2/2) - Clean, Pythonic code; seasonal pattern loop is appropriate complexity
  • CQ-05: Output & API (1/1) - Saves plot.png with correct dimensions (1600×900, scale=3) and plot.html

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of go.Heatmap with colorscale, zmid, texttemplate, hovertemplate, and go.Figure with update_layout
  • LM-02: Distinctive Features (3/5) - Uses Plotly-distinctive hovertemplate, HTML export, and texttemplate formatting; standard but not deeply unique Plotly patterns

Strengths

  • Excellent data storytelling with realistic seasonal retail patterns that make the heatmap informative and engaging
  • Publication-quality typography using serif fonts (Palatino/Georgia) with carefully set font sizes at every level
  • Diverging RdBu colorscale centered at zero with signed numeric annotations in every cell — clear and informative
  • Clean code structure with appropriate data generation complexity for realistic seasonal patterns
  • Plotly-idiomatic usage of hovertemplate, texttemplate, and HTML export alongside static PNG

Weaknesses

  • Right margin slightly tight — colorbar "Sales Growth (%)" title is close to the canvas edge; increasing right margin or adjusting colorbar position would improve balance
  • Could leverage more distinctive Plotly features (e.g., custom hoverinfo with category-specific details, or zmin/zmax for symmetric range)

Verdict: APPROVED

@github-actions github-actions Bot added quality:92 Quality score 92/100 ai-approved Quality OK, ready for merge labels Feb 15, 2026
Copilot AI review requested due to automatic review settings February 15, 2026 21:46
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 15, 2026 21:46
Copilot AI review requested due to automatic review settings February 15, 2026 21:46
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 15, 2026 21:46
@github-actions github-actions Bot merged commit fcc167f into main Feb 15, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/heatmap-basic/plotly branch February 15, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt ai-attempt-2 Second repair attempt quality:88 Quality score: 88/100 quality:89 Quality score 89/100 quality:92 Quality score 92/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants